#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main(int argc, char * argv[])
{
    int i = 1;
	ifstream in("config.dat",ios::binary);
    ofstream out("tracklist.txt",ios::binary);

    out << "<table width=\"100%\" border=\"0\">\n";

    char c;
    in.read(&c,1);
    while(!in.eof())
    {

        while(!in.eof() & c!='\n')
            in.read(&c,1);
        while(!in.eof() & c!='=')
            in.read(&c,1);
        in.read(&c,1);

        out << "<tr>\n";
        out << "<td>" << i++ << "</td>\n";
        out << "<td>";
        while(!in.eof() & c!='\n')
        {
            out.write(&c,1);
            in.read(&c,1);
        }
        out << "</td>\n";
        out << "<td></td>\n";
        out << "</tr>\n";

        in.read(&c,1);
        while(!in.eof() & c!='\n')
            in.read(&c,1);
        in.read(&c,1);
        while(!in.eof() & c!='\n')
            in.read(&c,1);

    }
    out << "</table>\n";
    in.close();
    out.close();
	return 0;
}
